package cn.iocoder.yudao.module.member.dal.mysql.usercreativetext;

import java.util.*;

import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.module.member.dal.dataobject.usercreativetext.UserCreativeTextDO;
import org.apache.ibatis.annotations.Mapper;
import cn.iocoder.yudao.module.member.controller.admin.usercreativetext.vo.*;

/**
 * 用户创意文案 Mapper
 *
 * @author 芋道源码
 */
@Mapper
public interface UserCreativeTextMapper extends BaseMapperX<UserCreativeTextDO> {

    default PageResult<UserCreativeTextDO> selectPage(UserCreativeTextPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<UserCreativeTextDO>()
                .betweenIfPresent(UserCreativeTextDO::getCreateTime, reqVO.getCreateTime())
                .eqIfPresent(UserCreativeTextDO::getUserId, reqVO.getUserId())
                .eqIfPresent(UserCreativeTextDO::getContent, reqVO.getContent())
                .eqIfPresent(UserCreativeTextDO::getLevel, reqVO.getLevel())
                .eqIfPresent(UserCreativeTextDO::getWinning, reqVO.getWinning())
                .eqIfPresent(UserCreativeTextDO::getTicketCount, reqVO.getTicketCount())
                .eqIfPresent(UserCreativeTextDO::getStatus, reqVO.getStatus())
                .eqIfPresent(UserCreativeTextDO::getRefuse, reqVO.getRefuse())
                .orderByDesc(UserCreativeTextDO::getId));
    }

}